package jmine.tec.subscription.impl;

import jmine.tec.subscription.Publication;
import jmine.tec.subscription.Publisher;
import jmine.tec.subscription.SubscriptionSettings;

/**
 * Abstracao para enviar eventos novos.
 * 
 * @author takeshi
 */
public interface EventRouter {

    /**
     * Faz o broadcast do {@link Publication}
     * 
     * @param <P> o tipo concreto da {@link Publication}
     * @param settings o {@link SubscriptionSettings}
     * @param publisher o {@link Publisher}
     * @param publication a {@link Publication}
     */
    <P extends Publication> void broadcast(SubscriptionSettings settings, Publisher<P> publisher, P publication);

    /**
     * Faz o broadcast do {@link PartialPublication}
     * 
     * @param <P> o tipo concreto da {@link Publication}
     * @param settings o {@link SubscriptionSettings}
     * @param publisher o {@link Publisher}
     * @param partial {@link PartialPublication} de P
     */
    <P extends Publication> void broadcastPartialPublication(SubscriptionSettings settings, Publisher<P> publisher,
            PartialPublication<P> partial);

}
